package com.liuzh.deviceinfo.pro;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextPaint;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import c.h.a.f0.j;
import c.h.b.d.a.e;
import c.h.b.d.a.h;
import c.h.b.d.a.i;

import com.liuzh.deviceinfo.R;
import com.liuzh.deviceinfo.base.BaseActivity;

import java.util.Collections;
import java.util.Objects;
import java.util.Random;

public class ProActivity extends BaseActivity implements c.h.a.f0.j.a {
    public static final /* synthetic */ int z = 0;
    public TextView q;
    public e r;
    public TextView s;
    public TextView t;
    public View u;
    public TextView v;
    public TextView w;
    public View x;
    public c.h.b.d.a.b y = new d();

    public class a implements i {
        public final /* synthetic */ boolean a;

        public class a implements h {
            public void a() {
                ProActivity.this.x.setVisibility(8);
                a aVar = a.this;
                if (aVar.a) {
                    Toast.makeText(ProActivity.this, 2131690213, 0).show();
                }
            }

            public void b() {
                ProActivity.B(ProActivity.this, null);
            }

            /* JADX WARNING: Removed duplicated region for block: B:14:? A:{SYNTHETIC, RETURN} */
            /* JADX WARNING: Removed duplicated region for block: B:10:0x007b  */
            public void c(java.util.List<c.h.b.d.a.e> r6) {
                /*
                r5 = this;
                r6 = r6.iterator();
            L_0x0004:
                r0 = r6.hasNext();
                if (r0 == 0) goto L_0x0073;
            L_0x000a:
                r0 = r6.next();
                r0 = (c.h.b.d.a.e) r0;
                r1 = r0.a;
                r2 = "devinfo_vip";
                r1 = android.text.TextUtils.equals(r1, r2);
                if (r1 == 0) goto L_0x0004;
            L_0x001a:
                r6 = com.liuzh.deviceinfo.pro.ProActivity.a.this;
                r6 = com.liuzh.deviceinfo.pro.ProActivity.this;
                r6.r = r0;
                r0 = c.h.a.f0.j.d;
                r0 = r0.i();
                if (r0 == 0) goto L_0x0029;
            L_0x0028:
                goto L_0x0073;
            L_0x0029:
                r0 = r6.x;
                r1 = 8;
                r0.setVisibility(r1);
                r0 = 2131296566; // 0x7f090136 float:1.8211052E38 double:1.0530004144E-314;
                r0 = r6.findViewById(r0);
                r1 = 0;
                r0.setVisibility(r1);
                r0 = r6.s;
                r2 = r6.r;
                r2 = r2.b;
                r0.setText(r2);
                r0 = r6.t;
                r2 = 2131690155; // 0x7f0f02ab float:1.9009346E38 double:1.053194873E-314;
                r3 = 1;
                r3 = new java.lang.Object[r3];
                r4 = r6.r;
                r4 = r4.c;
                r3[r1] = r4;
                r1 = r6.getString(r2, r3);
                r0.setText(r1);
                r0 = r6.v;
                r1 = 2131690364; // 0x7f0f037c float:1.900977E38 double:1.0531949764E-314;
                r0.setText(r1);
                r0 = r6.w;
                r1 = 2131690176; // 0x7f0f02c0 float:1.9009388E38 double:1.0531948835E-314;
                r0.setText(r1);
                r0 = r6.w;
                r1 = new c.h.a.f0.d;
                r1.m1965init(r6);
                r0.setOnClickListener(r1);
            L_0x0073:
                r6 = com.liuzh.deviceinfo.pro.ProActivity.a.this;
                r6 = com.liuzh.deviceinfo.pro.ProActivity.this;
                r6 = r6.r;
                if (r6 != 0) goto L_0x007e;
            L_0x007b:
                r5.a();
            L_0x007e:
                return;
                */
                throw new UnsupportedOperationException("Method not decompiled: com.liuzh.deviceinfo.pro.ProActivity$a$a.c(java.util.List):void");
            }
        }

        public a(boolean z) {
            this.a = z;
        }

        public void a() {
            c();
        }

        public void b(c.h.b.c.a.h hVar) {
            ProActivity.B(ProActivity.this, hVar);
        }

        public void c() {
            j jVar = j.d;
            jVar.a.d(ProActivity.this, 1, Collections.singletonList("devinfo_vip"), new a());
        }
    }

    public class b implements i {
        public final /* synthetic */ String a;

        public b(String str) {
            this.a = str;
        }

        public void a() {
            ProActivity.A(ProActivity.this, this.a, true, false);
        }

        public void b(c.h.b.c.a.h hVar) {
            if (!hVar.a(ProActivity.this, 1)) {
                Toast.makeText(ProActivity.this, 2131689839, 0).show();
            }
        }

        public void c() {
            ProActivity.A(ProActivity.this, this.a, true, false);
        }
    }

    public class c implements c.h.b.d.a.a {
        public final /* synthetic */ boolean a;
        public final /* synthetic */ boolean b;

        public c(boolean z, boolean z2) {
            this.a = z;
            this.b = z2;
        }
    }

    public class d implements c.h.b.d.a.b {
        public void a() {
            Toast.makeText(ProActivity.this, 2131689839, 0).show();
        }
    }

    public static void A(ProActivity proActivity, String str, boolean z, boolean z2) {
        Objects.requireNonNull(proActivity);
        j jVar = j.d;
        jVar.a.c(proActivity, 1, new c.h.a.f0.h(proActivity, str, z, z2));
    }

    public static void B(ProActivity proActivity, c.h.b.c.a.h hVar) {
        Objects.requireNonNull(proActivity);
        Toast.makeText(proActivity, 2131690054, 0).show();
        proActivity.x.setVisibility(8);
        proActivity.v.setText(2131690189);
        String str = "--";
        proActivity.s.setText(str);
        proActivity.t.setText(str);
        proActivity.w.setText(2131690054);
        if (hVar != null) {
            proActivity.w.setOnClickListener(new c.h.a.f0.b(proActivity, hVar));
        }
    }

    public static void F(Context context) {
        Objects.requireNonNull(j.d);
        context.startActivity(new Intent(context, ProActivity.class));
    }

    public static boolean G(Context context) {
        if (new Random().nextInt(10) >= 4) {
            return false;
        }
        F(context);
        return true;
    }

    public final void C(Intent intent, boolean z, boolean z2) {
        j jVar = j.d;
        jVar.a.a(intent, new c(z, z2));
    }

    public final void D(String str) {
        j jVar = j.d;
        jVar.a.f(this, new b(str));
    }

    public final void E(boolean z) {
        this.x.setVisibility(0);
        String str = "";
        this.s.setText(str);
        this.t.setText(str);
        this.v.setText(str);
        this.w.setText(2131690176);
        this.w.setOnClickListener(new c.h.a.f0.c(this));
        j jVar = j.d;
        jVar.a.f(this, new a(z));
    }

    public void i(boolean z) {
        int i = 8;
        if (z) {
            this.x.setVisibility(8);
            this.q.setVisibility(8);
        }
        this.u.setVisibility(z ? 8 : 0);
        this.w.setVisibility(z ? 8 : 0);
        findViewById(2131296566).setVisibility(z ? 8 : 0);
        View findViewById = findViewById(2131297309);
        if (z) {
            i = 0;
        }
        findViewById.setVisibility(i);
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 1) {
            C(intent, true, false);
        } else if (i == 2) {
            j jVar = j.d;
            jVar.a.b(this, intent, this.y);
        } else if (i == 3) {
            C(intent, false, false);
        } else if (i == 4) {
            C(intent, false, true);
        }
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        z();
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getString(2131689568));
        stringBuilder.append(" ");
        stringBuilder.append(getString(2131690189));
        setTitle(stringBuilder.toString());
        setContentView(R.layout.activity_pro);
        TextView textView = (TextView) findViewById(2131296406);
        this.w = textView;
        textView.setOnClickListener(new c.h.a.f0.e(this));
        View findViewById = findViewById(2131296907);
        this.u = findViewById;
        this.s = (TextView) findViewById.findViewById(2131296802);
        textView = (TextView) this.u.findViewById(2131296772);
        this.t = textView;
        TextPaint paint = textView.getPaint();
        paint.setFlags(paint.getFlags() | 16);
        this.v = (TextView) this.u.findViewById(2131296908);
        textView = (TextView) findViewById(2131296836);
        this.q = textView;
        paint = textView.getPaint();
        paint.setFlags(paint.getFlags() | 8);
        this.q.setOnClickListener(new c.h.a.f0.a(this));
        this.x = findViewById(2131296807);
        j jVar = j.d;
        if (jVar.i()) {
            this.x.setVisibility(8);
        } else {
            E(true);
        }
        ((TextView) findViewById(2131296788)).setText(2131690173);
        i(jVar.i());
        jVar.h(this);
    }

    public void onDestroy() {
        super.onDestroy();
        j.d.j(this);
    }
}
